﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace FW_code
{
    public class SearchFile
    {
        public void begin()
        {
            var mulu = Console.ReadLine();
            DirectoryInfo theFolder = new DirectoryInfo(mulu);
            DirectoryInfo[] dirInfo = theFolder.GetDirectories();
            //遍历文件夹
            foreach (DirectoryInfo NextFolder in dirInfo)
            {
                // this.listBox1.Items.Add(NextFolder.Name);
                FileInfo[] fileInfo = NextFolder.GetFiles();
                foreach (FileInfo NextFile in fileInfo)  //遍历文件
                {
                    if (NextFile.Name.Contains("Default.aspx.designer.cs"))
                    {
                        Default sf = new Default();
                        sf.write(NextFile.FullName);
                        Console.WriteLine(NextFile.FullName);
                    }
                    if (NextFile.Name.Contains("Manager.aspx.designer.cs"))
                    {
                        Manager mf = new Manager();
                        mf.write(NextFile.FullName);
                        Console.WriteLine(NextFile.FullName);
                    }
                }
            }
            Console.WriteLine("OK");
            Console.ReadLine();
        }
    }
}
